package com.lbd.system.bean;

import com.lbd.base.bean.AbstractEntity;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * 系统消息
 * Created by zzl on 2016/9/27.
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@Entity
public class Message extends AbstractEntity {
    /**
     * 未读
     */
    public final static int SATE_UNREAD = 0;
    /**
     * 已读
     */
    public final static int SATE_READ = 1;
    /**
     * 删除
     */
    public final static int SATE_DEL = -1;

    //标题
    String title;
    //内容
    String content;
    //类别
    int category;
    //状态 -1删除 0未读 1已读
    Integer state;
    //发件人
    String sender;

    //收件人
    @ManyToOne
    @JoinColumn(name = "user_id")
    User user;
}
